<?php
/*

Version 0.1
SEMF - Web Desiging Framework for Sport Event Managment
Copyright (C) 2006, SEMF Developers

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*/

$semf_root = "../../";

$page_name=$_GET['page_name'];
$module=$_GET['module'];
$action=$_GET['action'];
$project_home = $_GET['project_home'];

$module_home = $semf_root.$project_home.$module."/";

//for a new file 
if($action == 'new')
{
 	//new filename..
 	$file_name = $module_home.$page_name.".xml";
	touch($file_name);
}
else if($action == 'rename' )
{
	$new_name = $_GET['new_name'];
	
 	$file_name = $module_home.$page_name.".xml";
	if(is_file($file_name))
	{
		$new_file_name = $module_home.$new_name.".xml";
		rename($file_name, $new_file_name);
	}
}
else if( $action == 'delete')
{
 	$file_name = $module_home.$page_name.".xml";
	if(is_file($file_name))
	{
		unlink($file_name);
	}
}
?>